package com.tcm.logistics.service.impl;

import com.tcm.logistics.dao.mapper.LogisticsPickupPointMapper;
import com.tcm.logistics.entity.LogisticsPickupPoint;
import com.tcm.logistics.service.LogisticsPickupPointService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class LogisticsPickupPointServiceImpl implements LogisticsPickupPointService {

    @Autowired
    private LogisticsPickupPointMapper logisticsPickupPointMapper;

    /**
     * 删除
     *
     * @param id
     * @param shopId
     * @return
     */
    @Override
    public int deleteByKey(Long id, Long shopId) {
        return logisticsPickupPointMapper.deleteByKey(id, shopId);
    }

    /**
     * 逻辑删除
     *
     * @param id
     * @param shopId
     * @return
     */
    @Override
    public int deleteLogicByKey(Long id, Long shopId) {
        return logisticsPickupPointMapper.deleteLogicByKey(id, shopId);
    }

    /**
     * 新增
     *
     * @param record
     * @return
     */
    @Override
    public int create(LogisticsPickupPoint record) {
        return logisticsPickupPointMapper.insert(record);
    }

    /**
     * 查询自提点
     *
     * @param id
     * @param shopId
     * @return
     */
    @Override
    public LogisticsPickupPoint findByKey(Long id, Long shopId) {
        return logisticsPickupPointMapper.findByKey(id,shopId);
    }

    /**
     * 查询自提点列表
     *
     * @param shopId
     * @return
     */
    @Override
    public List<LogisticsPickupPoint> listPickupPoint(Long shopId) {
        return logisticsPickupPointMapper.listPickupPoint(shopId);
    }

    /**
     * 更新自提点
     *
     * @param record
     * @return
     */
    @Override
    public int updateByKey(LogisticsPickupPoint record) {
        return logisticsPickupPointMapper.updateByKey(record);
    }
}
